<RibbonDefinitions>
  <RibbonDefinition>
    <UI>
      <Ribbon>
        <Tabs Id="Mscrm.Tabs">
          <Tab Id="EntityTemplateTab.account.NoRelationship.Form.Mscrm.Form.account.MainTab" Command="Mscrm.Form.account.MainTab" Title="Account" Description="Account" Sequence="10">
            <Scaling Id="Mscrm.Form.account.MainTab.Scaling">
              <MaxSize Id="Mscrm.Form.account.MainTab.Save.MaxSize" GroupId="Mscrm.Form.account.MainTab.Save" Sequence="10" Size="LargeMedium" />
              <MaxSize Id="Mscrm.Form.account.MainTab.Management.MaxSize" GroupId="Mscrm.Form.account.MainTab.Management" Sequence="20" Size="LargeLarge" />
              <MaxSize Id="Mscrm.Form.account.MainTab.Actions.MaxSize" GroupId="Mscrm.Form.account.MainTab.Actions" Sequence="30" Size="LargeMediumLarge" />
              <MaxSize Id="Mscrm.Form.account.MainTab.ExportData.MaxSize" GroupId="Mscrm.Form.account.MainTab.ExportData" Sequence="40" Size="MediumLargeMedium" />
              <MaxSize Id="Mscrm.Form.account.MainTab.Workflow.MaxSize" GroupId="Mscrm.Form.account.MainTab.Workflow" Sequence="50" Size="Large" />
              <MaxSize Id="Mscrm.Form.account.MainTab.Find.MaxSize" GroupId="Mscrm.Form.account.MainTab.Find" Sequence="60" Size="Large" />
              <Scale Id="Mscrm.Form.account.MainTab.Workflow.Scale.1" GroupId="Mscrm.Form.account.MainTab.Workflow" Sequence="70" Size="Medium" />
              <Scale Id="Mscrm.Form.account.MainTab.ExportData.Scale.1" GroupId="Mscrm.Form.account.MainTab.ExportData" Sequence="80" Size="MediumLargeSmall" />
              <Scale Id="Mscrm.Form.account.MainTab.Workflow.Scale.2" GroupId="Mscrm.Form.account.MainTab.Workflow" Sequence="90" Size="Popup" />
              <Scale Id="Mscrm.Form.account.MainTab.Save.Scale.1" GroupId="Mscrm.Form.account.MainTab.Save" Sequence="100" Size="LargeSmall" />
              <Scale Id="Mscrm.Form.account.MainTab.ExportData.Scale.2" GroupId="Mscrm.Form.account.MainTab.ExportData" Sequence="110" Size="Popup" />
              <Scale Id="Mscrm.Form.account.MainTab.Management.Scale.4" GroupId="Mscrm.Form.account.MainTab.Management" Sequence="120" Size="Popup" />
              <Scale Id="Mscrm.Form.account.MainTab.Save.Scale.2" GroupId="Mscrm.Form.account.MainTab.Save" Sequence="130" Size="Popup" />
              <Scale Id="Mscrm.Form.account.MainTab.Actions.Scale.1" GroupId="Mscrm.Form.account.MainTab.Actions" Sequence="140" Size="Popup" />
            </Scaling>
            <Groups Id="Mscrm.Form.account.MainTab.Groups">
              <Group Id="Mscrm.Form.account.MainTab.Save" Command="Mscrm.Enabled" Sequence="10" Title="$Resources:Ribbon.Form.MainTab.Save" Template="Mscrm.Templates.3.3">
                <Controls Id="Mscrm.Form.account.MainTab.Save.Controls">
                  <Button Id="Mscrm.Form.account.MainTab.Save.Save" ToolTipTitle="$Resources:Mscrm_Form_Other_MainTab_Save_Save_ToolTipTitle" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.Save" Command="Mscrm.SavePrimary" Sequence="10" LabelText="$Resources:Ribbon.Form.MainTab.Save.Save" Alt="$Resources:Ribbon.Form.MainTab.Save.Save" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/ribbon/save32.png" TemplateAlias="o1" />
                  <Button Id="Mscrm.Form.account.MainTab.Save.SaveAsComplete" ToolTipTitle="$Resources:Ribbon.Form.MainTab.Save.SaveAsComplete" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.SaveAsComplete" Command="Mscrm.SavePrimaryActivityAsComplete" Sequence="20" LabelText="$Resources:Ribbon.Form.MainTab.Save.SaveAsComplete" Alt="$Resources:Ribbon.Form.MainTab.Save.SaveAsComplete" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/placeholders/ribbon_placeholder_32.png" TemplateAlias="o1" />
                  <Button Id="Mscrm.Form.account.MainTab.Save.SaveAndClose" ToolTipTitle="$Resources:Mscrm_Form_Other_MainTab_Save_SaveAndClose_ToolTipTitle" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.SaveAndClose" Command="Mscrm.SaveAndClosePrimary" Sequence="30" LabelText="$Resources:Ribbon.Form.MainTab.Save.SaveAndClose" Alt="$Resources:Ribbon.Form.MainTab.Save.SaveAndClose" Image16by16="/_imgs/ribbon/saveandclose16.png" Image32by32="/_imgs/ribbon/saveandclose32.png" TemplateAlias="o2" />
                  <Button Id="Mscrm.Form.account.MainTab.Save.SaveAndNew" ToolTipTitle="$Resources:Mscrm_Form_Other_MainTab_Save_SaveAndNew_ToolTipTitle" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.SaveAndNew" Command="Mscrm.SaveAndNewPrimary" Sequence="40" LabelText="$Resources:Ribbon.Form.MainTab.Save.SaveAndNew" Alt="$Resources:Ribbon.Form.MainTab.Save.SaveAndNew" Image16by16="/_imgs/ribbon/saveandnew16.png" Image32by32="/_imgs/ribbon/saveandnew32.png" TemplateAlias="o2" />
                </Controls>
              </Group>
              <Group Id="Mscrm.Form.account.MainTab.Management" Command="Mscrm.Enabled" Sequence="20" Title="$Resources:Ribbon.HomepageGrid.MainTab.Management" Template="Mscrm.Templates.Flexible2">
                <Controls Id="Mscrm.Form.account.MainTab.Management.Controls">
                  <Button Id="Mscrm.Form.account.MainTab.Management.Delete" ToolTipTitle="$Resources:Mscrm_Form_Other_MainTab_Management_Delete_ToolTipTitle" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.Delete" Command="Mscrm.DeletePrimaryRecord" Sequence="20" LabelText="$Resources:Ribbon.HomepageGrid.MainTab.Management.Delete" Alt="$Resources:Ribbon.HomepageGrid.MainTab.Management.Delete" Image16by16="/_imgs/ribbon/delete16.png" Image32by32="/_imgs/ribbon/delete32.png" TemplateAlias="o1" />
                  <Button Id="Mscrm.Form.account.MainTab.Management.Activate" ToolTipTitle="$Resources:Ribbon.HomepageGrid.account.Record.Status.Activate" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.Activate" Command="Mscrm.Form.Activate" Sequence="30" Alt="$Resources:Ribbon.HomepageGrid.account.Record.Status.Activate" LabelText="$Resources:Ribbon.HomepageGrid.account.Record.Status.Activate" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/placeholders/ribbon_placeholder_32.png" TemplateAlias="o2" />
                  <Button Id="Mscrm.Form.account.MainTab.Management.Deactivate" ToolTipTitle="$Resources:Ribbon.HomepageGrid.account.Record.Status.Deactivate" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.Deactivate" Command="Mscrm.Form.Deactivate" Sequence="40" Alt="$Resources:Ribbon.HomepageGrid.account.Record.Status.Deactivate" LabelText="$Resources:Ribbon.HomepageGrid.account.Record.Status.Deactivate" Image16by16="/_imgs/ribbon/deactivate16.png" Image32by32="/_imgs/placeholders/ribbon_placeholder_32.png" TemplateAlias="o2" />
                </Controls>
              </Group>
              <Group Id="Mscrm.Form.account.MainTab.Actions" Command="Mscrm.Enabled" Sequence="30" Title="$Resources:Ribbon.HomepageGrid.MainTab.Actions" Template="Mscrm.Templates.Flexible3">
                <Controls Id="Mscrm.Form.account.MainTab.Actions.Controls">
                  <Button Id="Mscrm.Form.account.MainTab.Actions.AddNote" ToolTipTitle="$Resources:Ribbon.HomepageGrid.Add.Document.AddNote" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.AddNote" Command="Mscrm.AddNoteToPrimaryActivityRecord" Sequence="8" LabelText="$Resources:Ribbon.HomepageGrid.Add.Document.AddNote" Alt="$Resources:Ribbon.HomepageGrid.Add.Document.AddNote" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/ribbon/noteyellowadd32.png" TemplateAlias="o1" />
                  <Button Id="Mscrm.Form.account.MainTab.Actions.Close" ToolTipTitle="$Resources(EntityDisplayName):Ribbon.HomepageGrid.MainTab.Actions.Close" ToolTipDescription="$Resources:Mscrm_Form_Other_MainTab_Actions_Close_ToolTipDescription" Command="Mscrm.Form.CloseActivity" Sequence="9" LabelText="$Resources(EntityDisplayName):Ribbon.HomepageGrid.MainTab.Actions.Close" Alt="$Resources(EntityDisplayName):Ribbon.HomepageGrid.MainTab.Actions.Close" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/placeholders/ribbon_placeholder_32.png" TemplateAlias="o1" />
                  <Button Id="Mscrm.Form.account.MainTab.Actions.Assign" ToolTipTitle="$Resources:Ribbon.HomepageGrid.MainTab.Actions.Assign" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.Assign" Command="Mscrm.AssignPrimaryRecord" Sequence="10" LabelText="$Resources:Ribbon.HomepageGrid.MainTab.Actions.Assign" Alt="$Resources:Ribbon.HomepageGrid.MainTab.Actions.Assign" Image16by16="/_imgs/ribbon/assign16.png" Image32by32="/_imgs/ribbon/assign32.png" TemplateAlias="o1" />
                  <FlyoutAnchor Id="Mscrm.Form.account.MainTab.Actions.Permissions" ToolTipTitle="$Resources:Ribbon.HomepageGrid.MainTab.Actions.Permissions" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.Permissions" Command="Mscrm.ShareRecordsAndSecuredFieldsPrimaryRecord" Sequence="26" Alt="$Resources:Ribbon.HomepageGrid.MainTab.Actions.Permissions" LabelText="$Resources:Ribbon.HomepageGrid.MainTab.Actions.Permissions" Image16by16="/_imgs/ribbon/sharing16.png" Image32by32="/_imgs/ribbon/sharing32.png" TemplateAlias="o2">
                    <Menu Id="Mscrm.Form.account.MainTab.Actions.Permissions.Menu">
                      <MenuSection Id="Mscrm.Form.account.MainTab.Actions.Permissions.MenuSection" Sequence="10" DisplayMode="Menu16">
                        <Controls Id="Mscrm.Form.account.MainTab.Actions.Permissions.Controls">
                          <Button Id="Mscrm.Form.account.MainTab.Actions.Permissions.Sharing" ToolTipTitle="$Resources:Ribbon.HomepageGrid.MainTab.Actions.Sharing" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.Share" Command="Mscrm.SharePrimaryRecord" Sequence="10" Alt="$Resources:Ribbon.HomepageGrid.MainTab.Actions.Sharing" LabelText="$Resources:Ribbon.HomepageGrid.MainTab.Actions.Sharing" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/placeholders/ribbon_placeholder_32.png" />
                          <Button Id="Mscrm.Form.account.MainTab.Actions.Permissions.Grant" ToolTipTitle="$Resources:Ribbon.HomepageGrid.MainTab.Actions.Grant" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.Grant" Command="Mscrm.ShareSecuredFieldsPrimaryRecord" Sequence="20" Alt="$Resources:Ribbon.HomepageGrid.MainTab.Actions.Grant" LabelText="$Resources:Ribbon.HomepageGrid.MainTab.Actions.Grant" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/placeholders/ribbon_placeholder_32.png" />
                        </Controls>
                      </MenuSection>
                    </Menu>
                  </FlyoutAnchor>
                  <Button Id="Mscrm.Form.account.MainTab.Actions.AddToQueue" ToolTipTitle="$Resources:Ribbon.HomepageGrid.MainTab.Actions.AddToQueue" ToolTipDescription="$Resources:Mscrm_Form_Other_MainTab_Actions_AddToQueue_ToolTipDescription" Command="Mscrm.AddPrimaryToQueue" Sequence="30" LabelText="$Resources:Ribbon.HomepageGrid.MainTab.Actions.AddToQueue" Alt="$Resources:Ribbon.HomepageGrid.MainTab.Actions.AddToQueue" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/placeholders/ribbon_placeholder_32.png" TemplateAlias="o2" />
                  <Button Id="Mscrm.Form.account.MainTab.Actions.PromoteToResponse" ToolTipTitle="$Resources:MenuItem_Label_PromoteToResponse" ToolTipDescription="" Command="Mscrm.PromoteToResponse" Sequence="35" LabelText="$Resources:MenuItem_Label_PromoteToResponse" Alt="$Resources:MenuItem_Label_PromoteToResponse" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/placeholders/ribbon_placeholder_32.png" TemplateAlias="o2" />
                  <Button Id="Mscrm.Form.account.MainTab.Actions.AddToList" ToolTipTitle="$Resources:Ribbon.HomepageGrid.account.Add.AddToList" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.AddToMarketingList" Command="Mscrm.AddPrimaryToMarketingList" Sequence="35" Alt="$Resources:Ribbon.HomepageGrid.account.Add.AddToList" LabelText="$Resources:Ribbon.HomepageGrid.account.Add.AddToList" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/placeholders/ribbon_placeholder_32.png" TemplateAlias="o2" />
                  <SplitButton Id="Mscrm.Form.account.MainTab.Actions.AddConnection" ToolTipTitle="$Resources:Ribbon.Connection.Splitbutton.AddConnection.Label" ToolTipDescription="$Resources:Ribbon.Connection.Splitbutton.AddConnection.Tooltip" Command="Mscrm.AddConnectionForm" Sequence="40" LabelText="$Resources:Ribbon.Connection.Splitbutton.AddConnection.Label" Alt="$Resources:Ribbon.Connection.Splitbutton.AddConnection.Label" Image16by16="/_imgs/ribbon/addconnection16.png" Image32by32="/_imgs/ribbon/addconnection32.png" TemplateAlias="o2">
                    <Menu Id="Mscrm.Form.account.MainTab.Actions.ConnectToMe.Menu">
                      <MenuSection Id="Mscrm.Form.account.MainTab.Actions.ConnectToMe.MenuSection" Sequence="10" DisplayMode="Menu16">
                        <Controls Id="Mscrm.Form.account.MainTab.Actions.ConnectToMe.Controls">
                          <Button Id="Mscrm.Form.account.MainTab.Actions.AddConnectionNew" ToolTipTitle="$Resources:Ribbon.Connection.AddConnectionNew.Label" ToolTipDescription="$Resources:Ribbon.Connection.AddConnectionNew.Tooltip" Command="Mscrm.AddConnectionForm" Sequence="40" LabelText="$Resources:Ribbon.Connection.AddConnectionNew.Label" Alt="$Resources:Ribbon.Connection.AddConnectionNew.Label" />
                          <Button Id="Mscrm.Form.account.MainTab.Actions.AddConnectionToMe" ToolTipTitle="$Resources:Ribbon.Connection.AddConnectionToMe.Label" ToolTipDescription="$Resources:Ribbon.Connection.AddConnectionToMe.Tooltip" Command="Mscrm.AddConnectionToMeForm" Sequence="41" LabelText="$Resources:Ribbon.Connection.AddConnectionToMe.Label" Alt="$Resources:Ribbon.Connection.AddConnectionToMe.Label" />
                        </Controls>
                      </MenuSection>
                    </Menu>
                  </SplitButton>
                  <FlyoutAnchor Id="Mscrm.Form.account.MainTab.Actions.Convert" ToolTipTitle="$Resources:MenuItem_Label_Convert_Entity_Mask" ToolTipDescription="$Resources(EntityDisplayName):MenuItem_ToolTip_Convert_Entity_Mask" Command="Mscrm.Form.ConvertActivity" Sequence="60" Alt="$Resources:MenuItem_Label_Convert_Entity_Mask" LabelText="$Resources:MenuItem_Label_Convert_Entity_Mask" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/placeholders/ribbon_placeholder_32.png" TemplateAlias="o3">
                    <Menu Id="Mscrm.Form.account.MainTab.Actions.Convert.Menu">
                      <MenuSection Id="Mscrm.Form.account.MainTab.Actions.Convert.MenuSection" Sequence="10" DisplayMode="Menu16">
                        <Controls Id="Mscrm.Form.account.MainTab.Actions.Convert.Controls">
                          <Button Id="Mscrm.Form.account.MainTab.Actions.Convert.Opportunity" Command="Mscrm.Form.ConvertToOpportunity" Sequence="10" Alt="$Resources:MenuItem_ToolTip_ConvertToOpportunity" LabelText="$Resources:MenuItem_Label_ConvertToOpportunity" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/placeholders/ribbon_placeholder_32.png" ToolTipTitle="$Resources:Mscrm_Form_Other_MainTab_Actions_Convert_Opportunity_ToolTipTitle" ToolTipDescription="$Resources:Mscrm_Form_Other_MainTab_Actions_Convert_Opportunity_ToolTipDescription" />
                          <Button Id="Mscrm.Form.account.MainTab.Actions.Convert.Case" Command="Mscrm.Form.ConvertToCase" Sequence="20" Alt="$Resources:MenuItem_ToolTip_ConvertToCase" LabelText="$Resources:MenuItem_Label_ConvertToCase" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/placeholders/ribbon_placeholder_32.png" ToolTipTitle="$Resources:Mscrm_Form_Other_MainTab_Actions_Convert_Case_ToolTipTitle" ToolTipDescription="$Resources:Mscrm_Form_Other_MainTab_Actions_Convert_Case_ToolTipDescription" />
                        </Controls>
                      </MenuSection>
                    </Menu>
                  </FlyoutAnchor>
                </Controls>
              </Group>
              <Group Id="Mscrm.Form.account.MainTab.ExportData" Command="Mscrm.Enabled" Sequence="40" Title="$Resources:Ribbon.HomepageGrid.MainTab.ExportData" Template="Mscrm.Templates.3.3.3">
                <Controls Id="Mscrm.Form.account.MainTab.ExportData.Controls">
                  <FlyoutAnchor Id="Mscrm.Form.account.MainTab.ExportData.Reports" ToolTipTitle="$Resources:Ribbon.HomepageGrid.Data.Report.RunReport" ToolTipDescription="$Resources:Ribbon.Tooltip.RunReport" Command="Mscrm.ReportMenu.Form" PopulateDynamically="true" PopulateOnlyOnce="true" PopulateQueryCommand="Mscrm.ReportsMenu.Populate.Form" Sequence="10" LabelText="$Resources:Ribbon.HomepageGrid.Data.Report.RunReport" Alt="$Resources:Ribbon.HomepageGrid.Data.Report.RunReport" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/ribbon/runreport32.png" TemplateAlias="o2" />
                  <Button Id="Mscrm.Form.account.MainTab.ExportData.PrintPreview" ToolTipTitle="$Resources:Ribbon.HomepageGrid.MainTab.Print.PrintPreview" ToolTipDescription="$Resources:Ribbon.Tooltip.PrintPreview" Command="Mscrm.PrintPreviewPrimaryControl" Sequence="20" LabelText="$Resources:Ribbon.HomepageGrid.MainTab.Print.PrintPreview" Alt="$Resources:Ribbon.HomepageGrid.MainTab.Print.PrintPreview" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/ribbon/printpreview32.png" TemplateAlias="o3" />
                  <Button Id="Mscrm.Form.account.MainTab.ExportData.CopySelected" ToolTipTitle="$Resources:Ribbon.HomepageGrid.Record.Shortcut.Copy" ToolTipDescription="$Resources:Ribbon.Tooltip.CopyShortcut" Command="Mscrm.CopyShortcutPrimary" Sequence="30" LabelText="$Resources:Ribbon.HomepageGrid.Record.Shortcut.Copy" Alt="$Resources:Ribbon.HomepageGrid.Record.Shortcut.Copy" Image16by16="/_imgs/ribbon/copyshortcut16.png" Image32by32="/_imgs/ribbon/copyshortcut32.png" TemplateAlias="o3" />
                  <Button Id="Mscrm.Form.account.MainTab.ExportData.SendSelected" ToolTipTitle="$Resources:Ribbon.HomepageGrid.Record.Shortcut.Send" ToolTipDescription="$Resources:Ribbon.Tooltip.SendShortcut" Command="Mscrm.SendShortcutPrimary" Sequence="40" LabelText="$Resources:Ribbon.HomepageGrid.Record.Shortcut.Send" Alt="$Resources:Ribbon.HomepageGrid.Record.Shortcut.Send" Image16by16="/_imgs/ribbon/sendshortcut16.png" Image32by32="/_imgs/ribbon/sendshortcut32.png" TemplateAlias="o3" />
                </Controls>
              </Group>
              <Group Id="Mscrm.Form.account.MainTab.Workflow" Command="Mscrm.Enabled" Sequence="50" Title="$Resources:Ribbon.HomepageGrid.Data.Workflow" Template="Mscrm.Templates.3">
                <Controls Id="Mscrm.Form.account.MainTab.Workflow.Controls">
                  <Button Id="Mscrm.Form.account.MainTab.Workflow.RunWorkflow" ToolTipTitle="$Resources:Ribbon.HomepageGrid.Data.Workflow.RunWorkflow" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.RunWorkflow" Command="Mscrm.RunWorkflowPrimary" Sequence="20" LabelText="$Resources:Ribbon.HomepageGrid.Data.Workflow.RunWorkflow" Alt="$Resources:Ribbon.HomepageGrid.Data.Workflow.RunWorkflow" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/ribbon/runworkflow32.png" TemplateAlias="o1" />
                  <Button Id="Mscrm.Form.account.MainTab.Workflow.RunScript" ToolTipTitle="$Resources:Ribbon.HomepageGrid.Data.InteractiveWorkflow.RunScript" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.RunScript" Command="Mscrm.RunInteractiveWorkflowPrimary" Sequence="25" LabelText="$Resources:Ribbon.HomepageGrid.Data.InteractiveWorkflow.RunScript" Alt="$Resources:Ribbon.HomepageGrid.Data.InteractiveWorkflow.RunScript" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/placeholders/ribbon_placeholder_32.png" TemplateAlias="o1" />
                </Controls>
              </Group>
              <Group Id="Mscrm.Form.account.MainTab.Find" Command="Mscrm.Enabled" Sequence="60" Title="$Resources:Ribbon.HomepageGrid.MainTab.Find" Template="Mscrm.Templates.3">
                <Controls Id="Mscrm.Form.account.MainTab.Find.Controls">
                  <Button Id="Mscrm.Form.account.MainTab.Find.AdvancedFind" Command="Mscrm.OpenAdvancedFind" Sequence="10" LabelText="$Resources:Ribbon.HomepageGrid.MainTab.Find.AdvancedFind" ToolTipTitle="$Resources:Ribbon.HomepageGrid.MainTab.Find.AdvancedFind" ToolTipDescription="$Resources:Ribbon.HomepageGrid.AdvancedFind.TooltipDescription" Alt="$Resources:Ribbon.HomepageGrid.MainTab.Find.AdvancedFind" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/ribbon/advancedfind32.png" TemplateAlias="o1" />
                </Controls>
              </Group>
            </Groups>
          </Tab>
          <Tab Id="EntityTemplateTab.account.NoRelationship.Form.Mscrm.Form.account.Related" Command="Mscrm.Form.account.Related" Title="$Resources:Ribbon.HomepageGrid.Related.TabName" Description="$Resources:Ribbon.HomepageGrid.Related.TabName" Sequence="20">
            <Scaling Id="Mscrm.Form.account.Related.Scaling">
              <MaxSize Id="Mscrm.Form.account.Related.Document.MaxSize" GroupId="Mscrm.Form.account.Related.Document" Sequence="10" Size="Medium" />
              <MaxSize Id="Mscrm.Form.account.Related.Activities.MaxSize" GroupId="Mscrm.Form.account.Related.Activities" Sequence="20" Size="MaxSize" />
              <MaxSize Id="Mscrm.Form.account.Related.Relationship.MaxSize" GroupId="Mscrm.Form.account.Related.Relationship" Sequence="21" Size="LargeMediumLargeMedium" />
              <MaxSize Id="Mscrm.Form.account.Related.Marketing.MaxSize" GroupId="Mscrm.Form.account.Related.Marketing" Sequence="30" Size="LargeLarge" />
              <Scale Id="Mscrm.Form.account.Related.Activities.Scale.1" GroupId="Mscrm.Form.account.Related.Activities" Sequence="40" Size="Scale.1" />
              <Scale Id="Mscrm.Form.account.Related.Activities.Scale.2" GroupId="Mscrm.Form.account.Related.Activities" Sequence="50" Size="Scale.2" />
              <Scale Id="Mscrm.Form.account.Related.Activities.Scale.3" GroupId="Mscrm.Form.account.Related.Activities" Sequence="60" Size="Scale.3" />
              <Scale Id="Mscrm.Form.account.Related.Document.Scale.1" GroupId="Mscrm.Form.account.Related.Document" Sequence="70" Size="Popup" />
              <Scale Id="Mscrm.Form.account.Related.Activities.Scale.4" GroupId="Mscrm.Form.account.Related.Activities" Sequence="80" Size="Popup" />
              <Scale Id="Mscrm.Form.account.Related.Relationship.Scale.1" GroupId="Mscrm.Form.account.Related.Relationship" Sequence="85" Size="Popup" />
              <Scale Id="Mscrm.Form.account.Related.Marketing.Scale.1" GroupId="Mscrm.Form.account.Related.Marketing" Sequence="90" Size="Popup" />
            </Scaling>
            <Groups Id="Mscrm.Form.account.Related.Groups">
              <Group Id="Mscrm.Form.account.Related.Document" Command="Mscrm.Enabled" Sequence="10" Title="$Resources:Ribbon.HomepageGrid.Add.Document" Template="Mscrm.Templates.3">
                <Controls Id="Mscrm.Form.account.Related.Document.Controls">
                  <Button Id="Mscrm.Form.account.Related.Document.AddFile" ToolTipTitle="$Resources:Mscrm_Form_Other_Related_Document_AddFile_ToolTipTitle" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.AttachFile" Command="Mscrm.AddFileToPrimaryRecord" Sequence="10" LabelText="$Resources:Ribbon.HomepageGrid.Add.Document.AddFile" Alt="$Resources:Ribbon.HomepageGrid.Add.Document.AddFile" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/ribbon/attachment32.png" TemplateAlias="o1" />
                  <Button Id="Mscrm.Form.account.Related.Document.AddNote" ToolTipTitle="$Resources:Mscrm_Form_Other_Related_Document_AddNote_ToolTipTitle" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.AddNote" Command="Mscrm.AddNoteToPrimaryRecord" Sequence="20" LabelText="$Resources:Ribbon.HomepageGrid.Add.Document.AddNote" Alt="$Resources:Ribbon.HomepageGrid.Add.Document.AddNote" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/ribbon/noteyellowadd32.png" TemplateAlias="o1" />
                </Controls>
              </Group>
              <Group Id="Mscrm.Form.account.Related.Activities" Command="Mscrm.Enabled" Sequence="20" Title="$Resources:Ribbon.HomepageGrid.Add.Activities" Template="Mscrm.Templates.Activities">
                <Controls Id="Mscrm.Form.account.Related.Activities.Controls">
                  <Button Id="Mscrm.Form.account.Related.Activities.AddTask" Command="Mscrm.AddTaskToPrimaryRecord" Sequence="10" ToolTipTitle="$Resources:Mscrm_Form_Other_Related_Activities_AddTask_ToolTipTitle" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.AddTask" LabelText="{!EntityDisplayName:task}" Alt="{!EntityDisplayName:task}" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/ribbon/entity32_4212.png" TemplateAlias="c1" />
                  <Button Id="Mscrm.Form.account.Related.Activities.AddPhone" Command="Mscrm.AddPhoneToPrimaryRecord" Sequence="20" ToolTipTitle="$Resources:Mscrm_Form_Other_Related_Activities_AddPhone_ToolTipTitle" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.AddPhoneCall" LabelText="{!EntityDisplayName:phonecall}" Alt="{!EntityDisplayName:phonecall}" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/ribbon/entity32_4210.png" TemplateAlias="c2" />
                  <Button Id="Mscrm.Form.account.Related.Activities.AddServiceActivity" Command="Mscrm.AddServiceActivityToPrimaryRecord" Sequence="30" ToolTipTitle="$Resources:Mscrm_Form_Other_Related_Activities_AddServiceActivity_ToolTipTitle" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.AddServiceActivity" LabelText="{!EntityDisplayName:serviceappointment}" Alt="{!EntityDisplayName:serviceappointment}" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/placeholders/ribbon_placeholder_32.png" TemplateAlias="c3" />
                  <Button Id="Mscrm.Form.account.Related.Activities.AddEmail" Command="Mscrm.SendEmailPrimaryRecord" Sequence="40" ToolTipTitle="$Resources:Mscrm_Form_Other_Related_Activities_AddEmail_ToolTipTitle" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.AddEmail" LabelText="{!EntityDisplayName:email}" Alt="{!EntityDisplayName:email}" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/ribbon/entity32_4202.png" TemplateAlias="c4" />
                  <Button Id="Mscrm.Form.account.Related.Activities.AddAppointment" Command="Mscrm.AddAppointmentToPrimaryRecord" Sequence="50" ToolTipTitle="$Resources:Mscrm_Form_Other_Related_Activities_AddAppointment_ToolTipTitle" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.AddAppointment" LabelText="{!EntityDisplayName:appointment}" Alt="{!EntityDisplayName:appointment}" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/ribbon/entity32_4201.png" TemplateAlias="c5" />
                  <Button Id="Mscrm.Form.account.Related.Activities.AddLetter" Command="Mscrm.AddLetterToPrimaryRecord" Sequence="60" ToolTipTitle="$Resources:Mscrm_Form_Other_Related_Activities_AddLetter_ToolTipTitle" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.AddLetter" LabelText="{!EntityDisplayName:letter}" Alt="{!EntityDisplayName:letter}" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/ribbon/entity32_4207.png" TemplateAlias="c6" />
                  <Button Id="Mscrm.Form.account.Related.Activities.AddFax" Command="Mscrm.AddFaxToPrimaryRecord" Sequence="70" ToolTipTitle="$Resources:Mscrm_Form_Other_Related_Activities_AddFax_ToolTipTitle" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.AddFax" LabelText="{!EntityDisplayName:fax}" Alt="{!EntityDisplayName:fax}" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/ribbon/entity32_4204.png" TemplateAlias="c7" />
                  <Button Id="Mscrm.Form.account.Related.Activities.AddCampaignResponse" Command="Mscrm.AddCampaignResponseToPrimaryRecord" Sequence="80" ToolTipTitle="$Resources:Mscrm_Form_Other_Related_Activities_AddCampaignResponse_ToolTipTitle" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.AddCampaignResponse" LabelText="{!EntityDisplayName:campaignresponse}" Alt="{!EntityDisplayName:campaignresponse}" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/ribbon/entity32_4401.png" TemplateAlias="c8" />
                  <Button Id="Mscrm.Form.account.Related.Activities.AddRecurringAppointment" Command="Mscrm.AddRecurringAppointmentToPrimaryRecord" Sequence="81" ToolTipTitle="$Resources:Mscrm_Form_Other_Related_Activities_AddRecurringAppointment_ToolTipTitle" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.AddRecurringAppointment" LabelText="{!EntityDisplayName:recurringappointmentmaster}" Alt="{!EntityDisplayName:recurringappointmentmaster}" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/placeholders/ribbon_placeholder_32.png" TemplateAlias="c9" />
                  <FlyoutAnchor Id="Mscrm.Form.account.Related.Activities.AddOtherActivities" ToolTipTitle="$Resources:Ribbon.HomepageGrid.Add.Related.OtherActivities" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.AddOtherActivities" Command="Mscrm.Form.AddCustomActivity" PopulateDynamically="true" PopulateQueryCommand="Mscrm.DynamicMenu.Form.AddActivity" Sequence="90" LabelText="$Resources:Ribbon.HomepageGrid.Add.Related.OtherActivities" Alt="$Resources:Ribbon.HomepageGrid.Add.Related.OtherActivities" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/placeholders/ribbon_placeholder_32.png" TemplateAlias="c10" />
                </Controls>
              </Group>
              <Group Id="Mscrm.Form.account.Related.Relationship" Command="Mscrm.Enabled" Sequence="30" Title="$Resources:Ribbon.HomepageGrid.account.Relationship" Template="Mscrm.Templates.FourOverflow">
                <Controls Id="Mscrm.Form.account.Related.Relationship.Record.Controls">
                  <FlyoutAnchor Id="Mscrm.Form.account.Related.Relationship.Relationship" ToolTipTitle="$Resources:Ribbon.HomepageGrid.account.Add.Other.Relationship" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.AddRelationship" Command="Mscrm.Form.account.Relationship" Sequence="40" Alt="$Resources:Ribbon.HomepageGrid.account.Add.Other.Relationship" LabelText="$Resources:Ribbon.HomepageGrid.account.Add.Other.Relationship" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/ribbon/relationship32.png" TemplateAlias="o1">
                    <Menu Id="Mscrm.Form.account.Related.Relationship.Relationship.Menu">
                      <MenuSection Id="Mscrm.Form.account.Related.Relationship.Relationship.MenuSection" Sequence="10" DisplayMode="Menu16">
                        <Controls Id="Mscrm.Form.account.Related.Relationship.Relationship.Controls">
                          <Button Id="Mscrm.Form.account.Related.Relationship.Relationship.Opportunity" Command="Mscrm.Form.account.Relationship.Opportunity" Sequence="10" Alt="$Resources:Ribbon.HomepageGrid.account.Add.Other.Relationship.Opportunity" LabelText="$Resources:Ribbon.HomepageGrid.account.Add.Other.Relationship.Opportunity" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/placeholders/ribbon_placeholder_32.png" ToolTipTitle="$Resources:Mscrm_Form_account_Related_Relationship_Relationship_Opportunity_ToolTipTitle" ToolTipDescription="$Resources:Mscrm_Form_account_Related_Relationship_Relationship_Opportunity_ToolTipDescription" />
                          <Button Id="Mscrm.Form.account.Related.Relationship.Relationship.Customer" Command="Mscrm.Form.account.Relationship.Customer" Sequence="20" Alt="$Resources:Ribbon.HomepageGrid.account.Add.Other.Relationship.Customer" LabelText="$Resources:Ribbon.HomepageGrid.account.Add.Other.Relationship.Customer" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/placeholders/ribbon_placeholder_32.png" ToolTipTitle="$Resources:Mscrm_Form_account_Related_Relationship_Relationship_Customer_ToolTipTitle" ToolTipDescription="$Resources:Mscrm_Form_account_Related_Relationship_Relationship_Customer_ToolTipDescription" />
                        </Controls>
                      </MenuSection>
                    </Menu>
                  </FlyoutAnchor>
                </Controls>
              </Group>
              <Group Id="Mscrm.Form.account.Related.Marketing" Command="Mscrm.Enabled" Sequence="40" Title="$Resources:Ribbon.HomepageGrid.account.Add.Marketing" Template="Mscrm.Templates.3.3">
                <Controls Id="Mscrm.Form.account.Related.Marketing.Controls">
                  <Button Id="Mscrm.Form.account.Related.Marketing.MailMerge" ToolTipTitle="$Resources:Ribbon.HomepageGrid.account.MainTab.Actions.MailMerge" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.MailMerge" Command="Mscrm.MailMergePrimary" Sequence="10" Alt="$Resources:Ribbon.HomepageGrid.account.MainTab.Actions.MailMerge" LabelText="$Resources:Ribbon.HomepageGrid.account.MainTab.Actions.MailMerge" Image16by16="/_imgs/ribbon/mailmerge16.png" Image32by32="/_imgs/ribbon/mailmerge32.png" TemplateAlias="o1" />
                  <Button Id="Mscrm.Form.account.Related.Marketing.Campaign" Command="Mscrm.Disabled" Sequence="30" Alt="{!EntityDisplayName:campaign}" LabelText="{!EntityDisplayName:campaign}" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/placeholders/ribbon_placeholder_32.png" TemplateAlias="o2" ToolTipTitle="$Resources:Mscrm_Form_account_Related_Marketing_Campaign_ToolTipTitle" ToolTipDescription="$Resources:Mscrm_Form_account_Related_Marketing_Campaign_ToolTipDescription" />
                </Controls>
              </Group>
            </Groups>
          </Tab>
          <Tab Id="EntityTemplateTab.account.NoRelationship.Form.Mscrm.Form.account.Developer" Command="Mscrm.Form.account.Developer" Title="$Resources:Ribbon.HomepageGrid.Developer.TabName" Description="$Resources:Ribbon.HomepageGrid.Developer.TabName" Sequence="30">
            <Scaling Id="Mscrm.Form.account.Developer.Scaling">
              <MaxSize Id="Mscrm.Form.account.Developer.Design.MaxSize" GroupId="Mscrm.Form.account.Developer.Design" Sequence="10" Size="Large" />
              <MaxSize Id="Mscrm.Form.account.Developer.Customize.MaxSize" GroupId="Mscrm.Form.account.Developer.Customize" Sequence="20" Size="Large" />
              <MaxSize Id="Mscrm.Form.account.Developer.Publish.MaxSize" GroupId="Mscrm.Form.account.Developer.Publish" Sequence="30" Size="Large" />
              <Scale Id="Mscrm.Form.account.Developer.Customize.Scale.1" GroupId="Mscrm.Form.account.Developer.Customize" Sequence="40" Size="Popup" />
              <Scale Id="Mscrm.Form.account.Developer.Design.Scale.1" GroupId="Mscrm.Form.account.Developer.Design" Sequence="50" Size="Popup" />
              <Scale Id="Mscrm.Form.account.Developer.Publish.Scale.1" GroupId="Mscrm.Form.account.Developer.Publish" Sequence="60" Size="Popup" />
            </Scaling>
            <Groups Id="Mscrm.Form.account.Developer.Groups">
              <Group Id="Mscrm.Form.account.Developer.Design" Command="Mscrm.Enabled" Sequence="10" Title="$Resources:Ribbon.HomepageGrid.Developer.Design" Description="$Resources:Ribbon.HomepageGrid.Developer.Design" Template="Mscrm.Templates.3">
                <Controls Id="Mscrm.Form.account.Developer.Design.Controls">
                  <Button Id="Mscrm.Form.account.Developer.Design.FormDesign" ToolTipTitle="$Resources:Ribbon.Form.Data.Customize.FormDesign" ToolTipDescription="$Resources:Ribbon.Tooltip.DesignForm" Command="Mscrm.FormDesign.OpenFromForm" Sequence="10" LabelText="$Resources:Ribbon.Form.Data.Customize.FormDesign" Alt="$Resources:Ribbon.Form.Data.Customize.FormDesign" Image16by16="/_imgs/ribbon/formdesign16.png" Image32by32="/_imgs/placeholders/ribbon_placeholder_32.png" TemplateAlias="o1" />
                </Controls>
              </Group>
              <Group Id="Mscrm.Form.account.Developer.Customize" Command="Mscrm.Enabled" Sequence="20" Title="$Resources:Ribbon.HomepageGrid.Developer.Customize" Description="$Resources:Ribbon.HomepageGrid.Developer.Customize" Template="Mscrm.Templates.3">
                <Controls Id="Mscrm.Form.account.Developer.Customize.Controls">
                  <Button Id="Mscrm.Form.account.Developer.Customize.CustomizeEntity" ToolTipTitle="$Resources:Ribbon.Form.Developer.Customize.CustomizeEntity" ToolTipDescription="$Resources:Ribbon.Form.Developer.Customize.CustomizeEntity.TooTipDesc" Command="Mscrm.CustomizeEntity" Sequence="10" LabelText="$Resources:Ribbon.Form.Developer.Customize.CustomizeEntity" Alt="$Resources:Ribbon.Form.Developer.Customize.CustomizeEntity" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/placeholders/ribbon_placeholder_32.png" TemplateAlias="o1" />
                  <Button Id="Mscrm.Form.account.Developer.Customize.SolutionManagement" Command="Mscrm.Disabled" Sequence="20" LabelText="$Resources:Ribbon.Form.Developer.Customize.SolutionManagement" Alt="$Resources:Ribbon.Form.Developer.Customize.SolutionManagement" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/placeholders/ribbon_placeholder_32.png" TemplateAlias="o1" ToolTipTitle="$Resources:Mscrm_Form_Other_Developer_Customize_SolutionManagement_ToolTipTitle" ToolTipDescription="$Resources:Mscrm_Form_Other_Developer_Customize_SolutionManagement_ToolTipDescription" />
                </Controls>
              </Group>
              <Group Id="Mscrm.Form.account.Developer.Publish" Command="Mscrm.Enabled" Sequence="30" Title="$Resources:Ribbon.Form.Developer.Customize.Publish" Description="$Resources:Ribbon.Form.Developer.Customize.Publish" Template="Mscrm.Templates.3">
                <Controls Id="Mscrm.Form.account.Developer.Publish.Controls">
                  <Button Id="Mscrm.Form.account.Developer.Publish.PublishEntity" Command="Mscrm.PublishEntity" Sequence="10" ToolTipTitle="$Resources:Ribbon.Form.Developer.Customize.Publish.Entity" ToolTipDescription="$Resources:Ribbon.Form.Developer.Customize.Publish.Entity.TooTipDesc" LabelText="$Resources:Ribbon.Form.Developer.Customize.Publish.Entity" Alt="$Resources:Ribbon.Form.Developer.Customize.Publish.Entity" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/placeholders/ribbon_placeholder_32.png" TemplateAlias="o1" />
                  <Button Id="Mscrm.Form.account.Developer.Publish.PublishAll" Command="Mscrm.PublishAll" Sequence="20" ToolTipTitle="$Resources:Ribbon.Form.Developer.Customize.PublishAll" ToolTipDescription="$Resources:Ribbon.Form.Developer.Customize.PublishAll.TooTipDesc" LabelText="$Resources:Ribbon.Form.Developer.Customize.PublishAll" Alt="$Resources:Ribbon.Form.Developer.Customize.PublishAll" Image16by16="/_imgs/placeholders/ribbon_placeholder_16.png" Image32by32="/_imgs/placeholders/ribbon_placeholder_32.png" TemplateAlias="o1" />
                </Controls>
              </Group>
            </Groups>
          </Tab>
        </Tabs>
        <ContextualTabs Id="Mscrm.ContextualTabs" />
      </Ribbon>
    </UI>
    <Templates>
      <RibbonTemplates Id="Mscrm.RibbonTemplates">
        <GroupTemplate Id="Mscrm.Templates.3">
          <Layout Title="Large">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="OneRow" TemplateAlias="isv" DisplayMode="Large" />
          </Layout>
          <Layout Title="Medium">
            <OverflowSection Type="ThreeRow" TemplateAlias="o1" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Medium" />
          </Layout>
          <Layout Title="Small">
            <OverflowSection Type="ThreeRow" TemplateAlias="o1" DisplayMode="Small" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Small" />
          </Layout>
          <Layout Title="Popup" LayoutTitle="Large" />
        </GroupTemplate>
        <GroupTemplate Id="Mscrm.Templates.3.3">
          <Layout Title="LargeLarge">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="OneRow" TemplateAlias="o2" DisplayMode="Large" />
            <OverflowSection Type="OneRow" TemplateAlias="isv" DisplayMode="Large" />
          </Layout>
          <Layout Title="LargeMedium">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Medium" />
          </Layout>
          <Layout Title="LargeSmall">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Small" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Small" />
          </Layout>
          <Layout Title="MediumMedium">
            <OverflowSection Type="ThreeRow" TemplateAlias="o1" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Medium" />
          </Layout>
          <Layout Title="MediumSmall">
            <OverflowSection Type="ThreeRow" TemplateAlias="o1" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Small" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Small" />
          </Layout>
          <Layout Title="SmallSmall">
            <OverflowSection Type="ThreeRow" TemplateAlias="o1" DisplayMode="Small" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Small" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Small" />
          </Layout>
          <Layout Title="Popup" LayoutTitle="LargeMedium" />
        </GroupTemplate>
        <GroupTemplate Id="Mscrm.Templates.3.3.3">
          <Layout Title="LargeLargeMedium">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="OneRow" TemplateAlias="o2" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o3" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Medium" />
          </Layout>
          <Layout Title="LargeMediumLarge">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Medium" />
            <OverflowSection Type="OneRow" TemplateAlias="o3" DisplayMode="Large" />
            <OverflowSection Type="OneRow" TemplateAlias="isv" DisplayMode="Large" />
          </Layout>
          <Layout Title="LargeMediumMedium">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o3" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Medium" />
          </Layout>
          <Layout Title="LargeSmallMedium">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Small" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o3" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Medium" />
          </Layout>
          <Layout Title="LargeSmallSmall">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Small" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o3" DisplayMode="Small" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Small" />
          </Layout>
          <Layout Title="MediumLargeMedium">
            <OverflowSection Type="ThreeRow" TemplateAlias="o1" DisplayMode="Medium" />
            <OverflowSection Type="OneRow" TemplateAlias="o2" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o3" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Medium" />
          </Layout>
          <Layout Title="MediumLargeSmall">
            <OverflowSection Type="ThreeRow" TemplateAlias="o1" DisplayMode="Medium" />
            <OverflowSection Type="OneRow" TemplateAlias="o2" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o3" DisplayMode="Small" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Small" />
          </Layout>
          <Layout Title="Popup" LayoutTitle="LargeMediumMedium" />
        </GroupTemplate>
        <GroupTemplate Id="Mscrm.Templates.4.3.3">
          <Layout Title="LargeMediumLarge">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Medium" />
            <OverflowSection Type="OneRow" TemplateAlias="o3" DisplayMode="Large" />
            <OverflowSection Type="OneRow" TemplateAlias="isv" DisplayMode="Large" />
          </Layout>
          <Layout Title="Popup" LayoutTitle="LargeMediumLarge" />
        </GroupTemplate>
        <GroupTemplate Id="Mscrm.Templates.Activities">
          <Layout Title="MaxSize">
            <Section Type="OneRow">
              <Row>
                <ControlRef TemplateAlias="c1" DisplayMode="Large" />
              </Row>
            </Section>
            <Section Type="ThreeRow">
              <Row>
                <ControlRef TemplateAlias="c2" DisplayMode="Medium" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c3" DisplayMode="Medium" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c4" DisplayMode="Medium" />
              </Row>
            </Section>
            <Section Type="OneRow">
              <Row>
                <ControlRef TemplateAlias="c5" DisplayMode="Large" />
              </Row>
            </Section>
            <Section Type="ThreeRow">
              <Row>
                <ControlRef TemplateAlias="c6" DisplayMode="Medium" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c7" DisplayMode="Medium" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c8" DisplayMode="Medium" />
              </Row>
            </Section>
            <Section Type="OneRow">
              <Row>
                <ControlRef TemplateAlias="c9" DisplayMode="Large" />
              </Row>
            </Section>
            <Section Type="OneRow">
              <Row>
                <ControlRef TemplateAlias="c10" DisplayMode="Large" />
              </Row>
            </Section>
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="OneRow" TemplateAlias="isv" DisplayMode="Large" />
          </Layout>
          <Layout Title="Scale.1">
            <Section Type="OneRow">
              <Row>
                <ControlRef TemplateAlias="c1" DisplayMode="Large" />
              </Row>
            </Section>
            <Section Type="ThreeRow">
              <Row>
                <ControlRef TemplateAlias="c5" DisplayMode="Medium" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c2" DisplayMode="Medium" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c4" DisplayMode="Medium" />
              </Row>
            </Section>
            <Section Type="ThreeRow">
              <Row>
                <ControlRef TemplateAlias="c9" DisplayMode="Medium" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c3" DisplayMode="Medium" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c8" DisplayMode="Medium" />
              </Row>
            </Section>
            <Section Type="ThreeRow">
              <Row>
                <ControlRef TemplateAlias="c6" DisplayMode="Medium" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c7" DisplayMode="Medium" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c10" DisplayMode="Medium" />
              </Row>
            </Section>
            <OverflowSection Type="ThreeRow" TemplateAlias="o1" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Medium" />
          </Layout>
          <Layout Title="Scale.2">
            <Section Type="OneRow">
              <Row>
                <ControlRef TemplateAlias="c1" DisplayMode="Large" />
              </Row>
            </Section>
            <Section Type="ThreeRow">
              <Row>
                <ControlRef TemplateAlias="c5" DisplayMode="Medium" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c2" DisplayMode="Medium" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c4" DisplayMode="Medium" />
              </Row>
            </Section>
            <Section Type="ThreeRow">
              <Row>
                <ControlRef TemplateAlias="c9" DisplayMode="Medium" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c3" DisplayMode="Medium" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c8" DisplayMode="Medium" />
              </Row>
            </Section>
            <Section Type="ThreeRow">
              <Row>
                <ControlRef TemplateAlias="c6" DisplayMode="Small" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c7" DisplayMode="Small" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c10" DisplayMode="Small" />
              </Row>
            </Section>
            <OverflowSection Type="ThreeRow" TemplateAlias="o1" DisplayMode="Small" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Small" />
          </Layout>
          <Layout Title="Scale.3">
            <Section Type="OneRow">
              <Row>
                <ControlRef TemplateAlias="c1" DisplayMode="Large" />
              </Row>
            </Section>
            <Section Type="ThreeRow">
              <Row>
                <ControlRef TemplateAlias="c5" DisplayMode="Medium" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c2" DisplayMode="Medium" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c4" DisplayMode="Medium" />
              </Row>
            </Section>
            <Section Type="ThreeRow">
              <Row>
                <ControlRef TemplateAlias="c9" DisplayMode="Small" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c3" DisplayMode="Small" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c8" DisplayMode="Small" />
              </Row>
            </Section>
            <Section Type="ThreeRow">
              <Row>
                <ControlRef TemplateAlias="c6" DisplayMode="Small" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c7" DisplayMode="Small" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c10" DisplayMode="Small" />
              </Row>
            </Section>
            <OverflowSection Type="ThreeRow" TemplateAlias="o1" DisplayMode="Small" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Small" />
          </Layout>
          <Layout Title="Scale.4">
            <Section Type="OneRow">
              <Row>
                <ControlRef TemplateAlias="c1" DisplayMode="Large" />
              </Row>
            </Section>
            <Section Type="ThreeRow">
              <Row>
                <ControlRef TemplateAlias="c5" DisplayMode="Small" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c2" DisplayMode="Small" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c4" DisplayMode="Small" />
              </Row>
            </Section>
            <Section Type="ThreeRow">
              <Row>
                <ControlRef TemplateAlias="c9" DisplayMode="Small" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c3" DisplayMode="Small" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c8" DisplayMode="Small" />
              </Row>
            </Section>
            <Section Type="ThreeRow">
              <Row>
                <ControlRef TemplateAlias="c6" DisplayMode="Small" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c7" DisplayMode="Small" />
              </Row>
              <Row>
                <ControlRef TemplateAlias="c10" DisplayMode="Small" />
              </Row>
            </Section>
            <OverflowSection Type="ThreeRow" TemplateAlias="o1" DisplayMode="Small" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Small" />
          </Layout>
          <Layout Title="Popup" LayoutTitle="MaxSize" />
        </GroupTemplate>
        <GroupTemplate Id="Mscrm.Templates.Flexible">
          <Layout Title="Large">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="OneRow" TemplateAlias="isv" DisplayMode="Large" />
          </Layout>
          <Layout Title="Medium">
            <OverflowSection Type="ThreeRow" TemplateAlias="o1" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Medium" />
          </Layout>
          <Layout Title="Small">
            <OverflowSection Type="ThreeRow" TemplateAlias="o1" DisplayMode="Small" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Small" />
          </Layout>
          <Layout Title="Popup" LayoutTitle="Large" />
        </GroupTemplate>
        <GroupTemplate Id="Mscrm.Templates.Flexible2">
          <Layout Title="LargeLarge">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="OneRow" TemplateAlias="o2" DisplayMode="Large" />
            <OverflowSection Type="OneRow" TemplateAlias="isv" DisplayMode="Large" />
          </Layout>
          <Layout Title="LargeMedium">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Medium" />
          </Layout>
          <Layout Title="LargeSmall">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Small" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Small" />
          </Layout>
          <Layout Title="Popup" LayoutTitle="LargeMedium" />
        </GroupTemplate>
        <GroupTemplate Id="Mscrm.Templates.Flexible3">
          <Layout Title="LargeLargeMedium">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="OneRow" TemplateAlias="o2" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o3" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Medium" />
          </Layout>
          <Layout Title="LargeMediumLarge">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Medium" />
            <OverflowSection Type="OneRow" TemplateAlias="o3" DisplayMode="Large" />
            <OverflowSection Type="OneRow" TemplateAlias="isv" DisplayMode="Large" />
          </Layout>
          <Layout Title="LargeMediumMedium">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o3" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Medium" />
          </Layout>
          <Layout Title="LargeSmallSmall">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Small" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o3" DisplayMode="Small" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Small" />
          </Layout>
          <Layout Title="MediumMediumSmall">
            <OverflowSection Type="ThreeRow" TemplateAlias="o1" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o3" DisplayMode="Small" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Small" />
          </Layout>
          <Layout Title="Popup" LayoutTitle="MediumMediumSmall" />
        </GroupTemplate>
        <GroupTemplate Id="Mscrm.Templates.Flexible4">
          <Layout Title="LargeMediumLargeLarge">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Medium" />
            <OverflowSection Type="OneRow" TemplateAlias="o3" DisplayMode="Large" />
            <OverflowSection Type="OneRow" TemplateAlias="o4" DisplayMode="Large" />
            <OverflowSection Type="OneRow" TemplateAlias="isv" DisplayMode="Large" />
          </Layout>
          <Layout Title="LargeLargeMediumLarge">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="OneRow" TemplateAlias="o2" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o3" DisplayMode="Medium" />
            <OverflowSection Type="OneRow" TemplateAlias="o4" DisplayMode="Large" />
            <OverflowSection Type="OneRow" TemplateAlias="isv" DisplayMode="Large" />
          </Layout>
          <Layout Title="LargeMediumMediumLarge">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o3" DisplayMode="Medium" />
            <OverflowSection Type="OneRow" TemplateAlias="o4" DisplayMode="Large" />
            <OverflowSection Type="OneRow" TemplateAlias="isv" DisplayMode="Large" />
          </Layout>
          <Layout Title="LargeMediumLargeMedium">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Medium" />
            <OverflowSection Type="OneRow" TemplateAlias="o3" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o4" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Medium" />
          </Layout>
          <Layout Title="LargeSmallLargeSmall">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Small" />
            <OverflowSection Type="OneRow" TemplateAlias="o3" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o4" DisplayMode="Small" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Small" />
          </Layout>
          <Layout Title="Popup" LayoutTitle="LargeMediumLargeMedium" />
        </GroupTemplate>
        <GroupTemplate Id="Mscrm.Templates.FourLargeButtons">
          <Layout Title="Large" LayoutTitle="Large">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="OneRow" TemplateAlias="isv" DisplayMode="Large" />
          </Layout>
          <Layout Title="Medium" LayoutTitle="Medium">
            <OverflowSection Type="TwoRow" TemplateAlias="o1" DisplayMode="Medium" />
            <OverflowSection Type="TwoRow" TemplateAlias="isv" DisplayMode="Medium" />
          </Layout>
        </GroupTemplate>
        <GroupTemplate Id="Mscrm.Templates.FourOverflow">
          <Layout Title="LargeMediumLargeLarge">
            <OverflowSection Type="OneRow" TemplateAlias="o5" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o6" DisplayMode="Medium" />
            <OverflowSection Type="OneRow" TemplateAlias="o7" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o8" DisplayMode="Medium" />
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Medium" />
            <OverflowSection Type="OneRow" TemplateAlias="o3" DisplayMode="Large" />
            <OverflowSection Type="OneRow" TemplateAlias="o4" DisplayMode="Large" />
            <OverflowSection Type="OneRow" TemplateAlias="isv" DisplayMode="Large" />
          </Layout>
          <Layout Title="LargeMediumLargeMedium">
            <OverflowSection Type="OneRow" TemplateAlias="o5" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o6" DisplayMode="Medium" />
            <OverflowSection Type="OneRow" TemplateAlias="o7" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o8" DisplayMode="Medium" />
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Medium" />
            <OverflowSection Type="OneRow" TemplateAlias="o3" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o4" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Medium" />
          </Layout>
          <Layout Title="Popup" LayoutTitle="LargeMediumLargeMedium" />
        </GroupTemplate>
        <GroupTemplate Id="Mscrm.Templates.OneLargeThreeMedium">
          <Layout Title="Large" LayoutTitle="Large">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Medium" />
          </Layout>
          <Layout Title="Medium" LayoutTitle="Medium">
            <OverflowSection Type="TwoRow" TemplateAlias="o1" DisplayMode="Small" />
            <OverflowSection Type="TwoRow" TemplateAlias="o2" DisplayMode="Small" />
            <OverflowSection Type="TwoRow" TemplateAlias="isv" DisplayMode="Medium" />
          </Layout>
        </GroupTemplate>
        <GroupTemplate Id="Mscrm.Templates.OneLargeTwoMedium">
          <Layout Title="Large" LayoutTitle="Large">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="TwoRow" TemplateAlias="o2" DisplayMode="Medium" />
            <OverflowSection Type="TwoRow" TemplateAlias="isv" DisplayMode="Medium" />
          </Layout>
          <Layout Title="Medium" LayoutTitle="Medium">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Small" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Medium" />
          </Layout>
          <Layout Title="Popup" LayoutTitle="Large" />
        </GroupTemplate>
        <GroupTemplate Id="Mscrm.Templates.ThreeLargeThreeMedium">
          <Layout Title="Large" LayoutTitle="Large">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Medium" />
          </Layout>
          <Layout Title="Medium" LayoutTitle="Medium">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Small" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Small" />
          </Layout>
        </GroupTemplate>
        <GroupTemplate Id="Mscrm.Templates.TwoLargeThreeMedium">
          <Layout Title="Large" LayoutTitle="Large">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Medium" />
            <OverflowSection Type="OneRow" TemplateAlias="o3" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Medium" />
          </Layout>
          <Layout Title="Medium" LayoutTitle="Medium">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="o2" DisplayMode="Small" />
            <OverflowSection Type="OneRow" TemplateAlias="o3" DisplayMode="Large" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Small" />
          </Layout>
        </GroupTemplate>
        <GroupTemplate Id="Mscrm.Templates.TwoLargeTwoMedium">
          <Layout Title="Large" LayoutTitle="Large">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="OneRow" TemplateAlias="o2" DisplayMode="Large" />
            <OverflowSection Type="TwoRow" TemplateAlias="o3" DisplayMode="Medium" />
            <OverflowSection Type="TwoRow" TemplateAlias="isv" DisplayMode="Medium" />
          </Layout>
          <Layout Title="Medium" LayoutTitle="Medium">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="TwoRow" TemplateAlias="o2" DisplayMode="Small" />
            <OverflowSection Type="TwoRow" TemplateAlias="o3" DisplayMode="Small" />
            <OverflowSection Type="TwoRow" TemplateAlias="isv" DisplayMode="Small" />
          </Layout>
        </GroupTemplate>
        <GroupTemplate Id="Mscrm.Templates.Visualization.Charts">
          <Layout Title="Large">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="OneRow" TemplateAlias="isv" DisplayMode="Large" />
          </Layout>
          <Layout Title="MediumMedium">
            <OverflowSection Type="ThreeRow" TemplateAlias="o1" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Medium" />
          </Layout>
          <Layout Title="Popup" LayoutTitle="Large" />
        </GroupTemplate>
        <GroupTemplate Id="Mscrm.Templates.VisualizationDesigner.Charts">
          <Layout Title="Large">
            <OverflowSection Type="OneRow" TemplateAlias="o1" DisplayMode="Large" />
            <OverflowSection Type="OneRow" TemplateAlias="isv" DisplayMode="Large" />
          </Layout>
          <Layout Title="MediumMedium">
            <OverflowSection Type="ThreeRow" TemplateAlias="o1" DisplayMode="Medium" />
            <OverflowSection Type="ThreeRow" TemplateAlias="isv" DisplayMode="Medium" />
          </Layout>
          <Layout Title="Popup" LayoutTitle="MediumMedium" />
        </GroupTemplate>
      </RibbonTemplates>
    </Templates>
    <CommandDefinitions>
      <CommandDefinition Id="Mscrm.AddPrimaryToMarketingList">
        <EnableRules>
          <EnableRule Id="Mscrm.AddPrimaryToMarketingList" />
          <EnableRule Id="Mscrm.FormStateExistingOrReadOnly" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.AddPrimaryToMarketingList" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.addPrimaryToMarketingList" Library="/_static/_common/scripts/RibbonActions.js">
            <CrmParameter Value="PrimaryEntityTypeCode" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.Form.{!EntityLogicalName}.MainTab">
        <EnableRules>
          <EnableRule Id="Mscrm.Form.{!EntityLogicalName}.MainTab" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.OutlookRenderTypeWeb" />
        </DisplayRules>
        <Actions />
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.Enabled">
        <EnableRules>
          <EnableRule Id="Mscrm.Enabled" />
        </EnableRules>
        <DisplayRules />
        <Actions />
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.SavePrimary">
        <EnableRules>
          <EnableRule Id="Mscrm.AvailableOnForm" />
          <EnableRule Id="Mscrm.CanSavePrimary" />
          <EnableRule Id="Mscrm.ReadPrimaryPermission" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.CanSavePrimaryEntityType" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.saveForm" Library="/_static/_common/scripts/RibbonActions.js">
            <CrmParameter Value="PrimaryControl" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.SavePrimaryActivityAsComplete">
        <EnableRules>
          <EnableRule Id="Mscrm.AvailableOnForm" />
          <EnableRule Id="Mscrm.CanSavePrimary" />
          <EnableRule Id="Mscrm.ReadPrimaryPermission" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.PrimaryIsActivity" />
          <DisplayRule Id="Mscrm.CanSavePrimaryEntityType" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="SaveAsCompleted" Library="/_static/activities/activity.js" />
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.SaveAndClosePrimary">
        <EnableRules>
          <EnableRule Id="Mscrm.AvailableOnForm" />
          <EnableRule Id="Mscrm.CanSavePrimary" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.CanSaveAndClosePrimaryEntityType" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.saveAndCloseForm" Library="/_static/_common/scripts/RibbonActions.js">
            <CrmParameter Value="PrimaryControl" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.SaveAndNewPrimary">
        <EnableRules>
          <EnableRule Id="Mscrm.AvailableOnForm" />
          <EnableRule Id="Mscrm.CanSavePrimary" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.CreatePrimaryEntityPermission" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.saveAndNewForm" Library="/_static/_common/scripts/RibbonActions.js">
            <CrmParameter Value="PrimaryControl" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.DeletePrimaryRecord">
        <EnableRules>
          <EnableRule Id="Mscrm.FormStateNotNew" />
          <EnableRule Id="Mscrm.CanDeletePrimary" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.DeletePrimaryEntityPermission" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="onActionMenuClick" Library="/_static/_forms/form.js">
            <StringParameter Value="delete" />
            <CrmParameter Value="PrimaryEntityTypeCode" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.Form.Activate">
        <EnableRules>
          <EnableRule Id="Mscrm.CanWritePrimary" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.CanWritePrimary" />
          <DisplayRule Id="Mscrm.PrimaryIsInactive" />
          <DisplayRule Id="Mscrm.PrimaryEntityHasStatecode" />
          <DisplayRule Id="Mscrm.PrimaryIsNotActivity" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="changeState" Library="/_static/_forms/form.js">
            <StringParameter Value="activate" />
            <CrmParameter Value="PrimaryEntityTypeCode" />
            <StringParameter Value="6" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.Form.Deactivate">
        <EnableRules>
          <EnableRule Id="Mscrm.CanWritePrimary" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.CanWritePrimary" />
          <DisplayRule Id="Mscrm.PrimaryIsActive" />
          <DisplayRule Id="Mscrm.PrimaryEntityHasStatecode" />
          <DisplayRule Id="Mscrm.PrimaryIsNotActivity" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="changeState" Library="/_static/_forms/form.js">
            <StringParameter Value="deactivate" />
            <CrmParameter Value="PrimaryEntityTypeCode" />
            <StringParameter Value="5" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.AddNoteToPrimaryActivityRecord">
        <EnableRules>
          <EnableRule Id="Mscrm.FormStateNotNew" />
          <EnableRule Id="Mscrm.AppendToPrimary" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.AppendToPrimary" />
          <DisplayRule Id="Mscrm.CreateAndAppendNote" />
          <DisplayRule Id="Mscrm.PrimaryEntityHasNotes" />
          <DisplayRule Id="Mscrm.PrimaryIsActivity" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.addNoteToRecord" Library="/_static/_common/scripts/RibbonActions.js">
            <CrmParameter Value="PrimaryEntityTypeCode" />
            <CrmParameter Value="FirstPrimaryItemId" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.Form.CloseActivity">
        <EnableRules>
          <EnableRule Id="Mscrm.CanWritePrimary" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.CanWritePrimary" />
          <DisplayRule Id="Mscrm.PrimaryIsActive" />
          <DisplayRule Id="Mscrm.PrimaryEntityHasStatecode" />
          <DisplayRule Id="Mscrm.PrimaryIsActivity" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="changeState" Library="/_static/_forms/form.js">
            <StringParameter Value="deactivate" />
            <CrmParameter Value="PrimaryEntityTypeCode" />
            <StringParameter Value="5" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.AssignPrimaryRecord">
        <EnableRules>
          <EnableRule Id="Mscrm.FormStateNotNew" />
          <EnableRule Id="Mscrm.AssignPrimaryPermission" />
          <EnableRule Id="Mscrm.NotOffline" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.AssignPrimaryPermission" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="assignObject" Library="/_static/_forms/form.js">
            <CrmParameter Value="PrimaryEntityTypeCode" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.ShareRecordsAndSecuredFieldsPrimaryRecord">
        <EnableRules>
          <EnableRule Id="Mscrm.FormStateNotNew" />
          <EnableRule Id="Mscrm.NotOffline" />
          <EnableRule Id="Mscrm.ShareRecordsAndSecuredFieldsPrimaryPermission" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.ShareRecordsAndSecuredFieldsPrimaryPermission" />
        </DisplayRules>
        <Actions />
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.SharePrimaryRecord">
        <EnableRules>
          <EnableRule Id="Mscrm.FormStateNotNew" />
          <EnableRule Id="Mscrm.SharePrimaryPermission" />
          <EnableRule Id="Mscrm.NotOffline" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.SharePrimaryPermission" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="onActionMenuClick" Library="/_static/_forms/form.js">
            <StringParameter Value="share" />
            <CrmParameter Value="PrimaryEntityTypeCode" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.ShareSecuredFieldsPrimaryRecord">
        <EnableRules>
          <EnableRule Id="Mscrm.FormStateNotNew" />
          <EnableRule Id="Mscrm.NotOffline" />
          <EnableRule Id="Mscrm.ShareSecuredFieldsPrimaryPermission" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.ShareSecuredFieldsPrimaryPermission" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="onActionMenuClick" Library="/_static/_forms/form.js">
            <StringParameter Value="grant" />
            <CrmParameter Value="PrimaryEntityTypeCode" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.AddPrimaryToQueue">
        <EnableRules>
          <EnableRule Id="Mscrm.AppendToPrimary" />
          <EnableRule Id="Mscrm.FormStateExistingOrReadOnly" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.AppendToPrimary" />
          <DisplayRule Id="Mscrm.AppendToQueue" />
          <DisplayRule Id="Mscrm.WorksWithQueuePrimary" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="addToQueue" Library="/_static/_forms/form.js">
            <CrmParameter Value="PrimaryEntityTypeCode" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.PromoteToResponse">
        <EnableRules>
          <EnableRule Id="Mscrm.EnablePromoteToResponse" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.PrimaryIsActivity" />
          <DisplayRule Id="Mscrm.CanCreateActivity" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="promoteToResponse" Library="/_static/activities/activity.js">
            <CrmParameter Value="PrimaryEntityTypeCode" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.AddConnectionForm">
        <EnableRules>
          <EnableRule Id="Mscrm.FormStateExistingOrReadOnly" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.CreateConnection" />
          <DisplayRule Id="Mscrm.IsConnectionsEnabledPrimary" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.addConnectionFromForm" Library="/_static/_common/scripts/RibbonActions.js">
            <CrmParameter Value="FirstPrimaryItemId" />
            <CrmParameter Value="PrimaryEntityTypeCode" />
            <CrmParameter Value="PrimaryControl" />
            <BoolParameter Value="false" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.AddConnectionToMeForm">
        <EnableRules>
          <EnableRule Id="Mscrm.FormStateExistingOrReadOnly" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.CreateConnection" />
          <DisplayRule Id="Mscrm.IsConnectionsEnabledPrimary" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.addConnectionFromForm" Library="/_static/_common/scripts/RibbonActions.js">
            <CrmParameter Value="FirstPrimaryItemId" />
            <CrmParameter Value="PrimaryEntityTypeCode" />
            <CrmParameter Value="PrimaryControl" />
            <BoolParameter Value="true" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.Form.ConvertActivity">
        <EnableRules>
          <EnableRule Id="Mscrm.ConvertActivity" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.ConvertActivity" />
        </DisplayRules>
        <Actions />
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.Form.ConvertToOpportunity">
        <EnableRules>
          <EnableRule Id="Mscrm.ConvertActivity" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.ConvertActivity" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="convertToOpportunity" Library="/_static/activities/activity.js">
            <CrmParameter Value="PrimaryEntityTypeCode" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.Form.ConvertToCase">
        <EnableRules>
          <EnableRule Id="Mscrm.ConvertActivity" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.ConvertActivity" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="convertToCase" Library="/_static/activities/activity.js">
            <CrmParameter Value="PrimaryEntityTypeCode" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.ReportMenu.Form">
        <EnableRules>
          <EnableRule Id="Mscrm.FormStateNotNew" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.ReadReport" />
        </DisplayRules>
        <Actions />
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.ReportsMenu.Populate.Form">
        <EnableRules />
        <DisplayRules />
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.ReportUtil.generateReportMenuXml" Library="/_common/global.ashx">
            <CrmParameter Value="CommandProperties" />
            <CrmParameter Value="PrimaryEntityTypeName" />
            <BoolParameter Value="true" />
            <CrmParameter Value="PrimaryControl" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.PrintPreviewPrimaryControl">
        <EnableRules>
          <EnableRule Id="Mscrm.FormStateNotNew" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.PrintPrivilege" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.print" Library="/_static/_common/scripts/RibbonActions.js">
            <CrmParameter Value="PrimaryControl" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.CopyShortcutPrimary">
        <EnableRules>
          <EnableRule Id="Mscrm.FormStateNotNew" />
        </EnableRules>
        <DisplayRules />
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.sendFormShortcut" Library="/_static/_common/scripts/RibbonActions.js">
            <BoolParameter Value="false" />
            <CrmParameter Value="PrimaryControl" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.SendShortcutPrimary">
        <EnableRules>
          <EnableRule Id="Mscrm.FormStateNotNew" />
        </EnableRules>
        <DisplayRules />
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.sendFormShortcut" Library="/_static/_common/scripts/RibbonActions.js">
            <BoolParameter Value="true" />
            <CrmParameter Value="PrimaryControl" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.RunWorkflowPrimary">
        <EnableRules>
          <EnableRule Id="Mscrm.FormStateNotNew" />
          <EnableRule Id="Mscrm.RunWorkflowPrimary" />
        </EnableRules>
        <DisplayRules />
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.FormAction.launchOnDemandWorkflowForm" Library="/_static/_forms/form.js">
            <CrmParameter Value="PrimaryEntityTypeCode" />
            <StringParameter Value="" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.RunInteractiveWorkflowPrimary">
        <EnableRules>
          <EnableRule Id="Mscrm.FormStateExistingOrReadOnly" />
          <EnableRule Id="Mscrm.RunWorkflowPrimary" />
        </EnableRules>
        <DisplayRules />
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.FormAction.runScript" Library="/_static/_forms/form.js">
            <CrmParameter Value="PrimaryEntityTypeCode" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.OpenAdvancedFind">
        <EnableRules />
        <DisplayRules />
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.openAdvancedFind" Library="/_static/_common/scripts/RibbonActions.js">
            <CrmParameter Value="SelectedControl" />
            <CrmParameter Value="PrimaryControl" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.Form.{!EntityLogicalName}.MainTab">
        <EnableRules>
          <EnableRule Id="Mscrm.Form.{!EntityLogicalName}.MainTab" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.OutlookRenderTypeWeb" />
        </DisplayRules>
        <Actions />
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.Ribbon.TabSwitch">
        <EnableRules />
        <DisplayRules />
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.onTabSwitch" Library="/_static/_common/scripts/RibbonActions.js">
            <CrmParameter Value="CommandProperties" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.Ribbon.RootEvent">
        <EnableRules />
        <DisplayRules />
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.onRootEvent" Library="/_static/_common/scripts/RibbonActions.js">
            <CrmParameter Value="CommandProperties" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.Form.account.Relationship">
        <EnableRules>
          <EnableRule Id="Mscrm.FormStateExisting" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.HomepageGrid.account.Relationship" />
        </DisplayRules>
        <Actions />
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.Form.account.Relationship.Opportunity">
        <EnableRules>
          <EnableRule Id="Mscrm.FormStateExisting" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.HomepageGrid.account.Relationship.Opportunity" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.addRelatedToNonForm" Library="/_static/_common/scripts/RibbonActions.js">
            <IntParameter Value="4503" />
            <IntParameter Value="1" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.Form.account.Relationship.Customer">
        <EnableRules>
          <EnableRule Id="Mscrm.FormStateExisting" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.HomepageGrid.account.Relationship.Customer" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.addRelatedToNonForm" Library="/_static/_common/scripts/RibbonActions.js">
            <IntParameter Value="4502" />
            <IntParameter Value="1" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.Disabled">
        <EnableRules>
          <EnableRule Id="Mscrm.Disabled" />
        </EnableRules>
        <DisplayRules />
        <Actions />
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.Form.{!EntityLogicalName}.Related">
        <EnableRules>
          <EnableRule Id="Mscrm.Form.{!EntityLogicalName}.Related" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.OutlookRenderTypeWeb" />
          <DisplayRule Id="Mscrm.PrimaryIsNotActivity" />
        </DisplayRules>
        <Actions />
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.AddFileToPrimaryRecord">
        <EnableRules>
          <EnableRule Id="Mscrm.FormStateNotNew" />
          <EnableRule Id="Mscrm.AppendToPrimary" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.AppendToPrimary" />
          <DisplayRule Id="Mscrm.CreateAndAppendNote" />
          <DisplayRule Id="Mscrm.PrimaryEntityHasNotes" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.addFileToRecord" Library="/_static/_common/scripts/RibbonActions.js">
            <CrmParameter Value="PrimaryEntityTypeCode" />
            <CrmParameter Value="FirstPrimaryItemId" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.AddNoteToPrimaryRecord">
        <EnableRules>
          <EnableRule Id="Mscrm.FormStateNotNew" />
          <EnableRule Id="Mscrm.AppendToPrimary" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.AppendToPrimary" />
          <DisplayRule Id="Mscrm.CreateAndAppendNote" />
          <DisplayRule Id="Mscrm.PrimaryEntityHasNotes" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.addNoteToRecord" Library="/_static/_common/scripts/RibbonActions.js">
            <CrmParameter Value="PrimaryEntityTypeCode" />
            <CrmParameter Value="FirstPrimaryItemId" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.AddTaskToPrimaryRecord">
        <EnableRules>
          <EnableRule Id="Mscrm.AppendToPrimary" />
          <EnableRule Id="Mscrm.FormStateExistingOrReadOnly" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.AddActivityToPrimary" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.addActivityOnForm" Library="/_static/_common/scripts/RibbonActions.js">
            <IntParameter Value="4212" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.AddPhoneToPrimaryRecord">
        <EnableRules>
          <EnableRule Id="Mscrm.AppendToPrimary" />
          <EnableRule Id="Mscrm.FormStateExistingOrReadOnly" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.AddActivityToPrimary" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.addActivityOnForm" Library="/_static/_common/scripts/RibbonActions.js">
            <IntParameter Value="4210" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.AddServiceActivityToPrimaryRecord">
        <EnableRules>
          <EnableRule Id="Mscrm.AppendToPrimary" />
          <EnableRule Id="Mscrm.FormStateExistingOrReadOnly" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.AddActivityToPrimary" />
          <DisplayRule Id="Mscrm.CreateServiceAppointment" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.addActivityOnForm" Library="/_static/_common/scripts/RibbonActions.js">
            <IntParameter Value="4214" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.SendEmailPrimaryRecord">
        <EnableRules>
          <EnableRule Id="Mscrm.FormStateExistingOrReadOnly" />
          <EnableRule Id="Mscrm.AppendToPrimary" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.AddActivityToPrimary" />
          <DisplayRule Id="Mscrm.WriteActivityPermission" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.addActivityOnForm" Library="/_static/_common/scripts/RibbonActions.js">
            <IntParameter Value="4202" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.AddAppointmentToPrimaryRecord">
        <EnableRules>
          <EnableRule Id="Mscrm.AppendToPrimary" />
          <EnableRule Id="Mscrm.FormStateExistingOrReadOnly" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.AddActivityToPrimary" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.addActivityOnForm" Library="/_static/_common/scripts/RibbonActions.js">
            <IntParameter Value="4201" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.AddLetterToPrimaryRecord">
        <EnableRules>
          <EnableRule Id="Mscrm.AppendToPrimary" />
          <EnableRule Id="Mscrm.FormStateExistingOrReadOnly" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.AddActivityToPrimary" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.addActivityOnForm" Library="/_static/_common/scripts/RibbonActions.js">
            <IntParameter Value="4207" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.AddFaxToPrimaryRecord">
        <EnableRules>
          <EnableRule Id="Mscrm.AppendToPrimary" />
          <EnableRule Id="Mscrm.FormStateExistingOrReadOnly" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.AddActivityToPrimary" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.addActivityOnForm" Library="/_static/_common/scripts/RibbonActions.js">
            <IntParameter Value="4204" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.AddCampaignResponseToPrimaryRecord">
        <EnableRules>
          <EnableRule Id="Mscrm.AppendToPrimary" />
          <EnableRule Id="Mscrm.FormStateExistingOrReadOnly" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.AddActivityToPrimary" />
          <DisplayRule Id="Mscrm.CreateCampaignResponse" />
          <DisplayRule Id="Mscrm.PrimaryEntityHasCampaignResponse" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.addActivityOnForm" Library="/_static/_common/scripts/RibbonActions.js">
            <IntParameter Value="4401" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.AddRecurringAppointmentToPrimaryRecord">
        <EnableRules>
          <EnableRule Id="Mscrm.AppendToPrimary" />
          <EnableRule Id="Mscrm.FormStateExistingOrReadOnly" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.AddActivityToPrimary" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.addActivityOnForm" Library="/_static/_common/scripts/RibbonActions.js">
            <IntParameter Value="4251" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.Form.AddCustomActivity">
        <EnableRules>
          <EnableRule Id="Mscrm.AppendToPrimary" />
          <EnableRule Id="Mscrm.FormStateExistingOrReadOnly" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.AddActivityToPrimary" />
        </DisplayRules>
        <Actions />
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.DynamicMenu.Form.AddActivity">
        <EnableRules />
        <DisplayRules />
        <Actions />
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.MailMergePrimary">
        <EnableRules>
          <EnableRule Id="Mscrm.FormStateExisting" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.MailMergePrimary" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="onActionMenuClick" Library="/_static/_forms/form.js">
            <StringParameter Value="webmailmerge" />
            <CrmParameter Value="PrimaryEntityTypeCode" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.Form.{!EntityLogicalName}.Related">
        <EnableRules>
          <EnableRule Id="Mscrm.Form.{!EntityLogicalName}.Related" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.OutlookRenderTypeWeb" />
          <DisplayRule Id="Mscrm.PrimaryIsNotActivity" />
        </DisplayRules>
        <Actions />
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.Form.{!EntityLogicalName}.Developer">
        <EnableRules>
          <EnableRule Id="Mscrm.Form.{!EntityLogicalName}.Developer" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.OutlookRenderTypeWeb" />
        </DisplayRules>
        <Actions />
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.FormDesign.OpenFromForm">
        <EnableRules>
          <EnableRule Id="Mscrm.FormDesignValid" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.WriteCustomization" />
          <DisplayRule Id="Mscrm.IsCustomizable" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.FormEditor.OpenFormEditor" Library="/_common/global.ashx">
            <CrmParameter Value="PrimaryEntityTypeCode" />
            <StringParameter Value="main" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.CustomizeEntity">
        <EnableRules />
        <DisplayRules>
          <DisplayRule Id="Mscrm.WriteCustomization" />
          <DisplayRule Id="Mscrm.OpenCustomizations" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.RibbonActions.openEntityEditor" Library="/_static/_common/scripts/RibbonActions.js">
            <CrmParameter Value="SelectedEntityTypeCode" />
            <CrmParameter Value="PrimaryEntityTypeCode" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.PublishEntity">
        <EnableRules />
        <DisplayRules>
          <DisplayRule Id="Mscrm.WriteCustomization" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.FormEditor.PublishEntity" Library="/_common/global.ashx">
            <CrmParameter Value="SelectedEntityTypeCode" />
            <CrmParameter Value="PrimaryEntityTypeCode" />
          </JavaScriptFunction>
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.PublishAll">
        <EnableRules />
        <DisplayRules>
          <DisplayRule Id="Mscrm.WriteCustomization" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction FunctionName="Mscrm.FormEditor.PublishAll" Library="/_common/global.ashx" />
        </Actions>
      </CommandDefinition>
      <CommandDefinition Id="Mscrm.Form.{!EntityLogicalName}.Developer">
        <EnableRules>
          <EnableRule Id="Mscrm.Form.{!EntityLogicalName}.Developer" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.OutlookRenderTypeWeb" />
        </DisplayRules>
        <Actions />
      </CommandDefinition>
    </CommandDefinitions>
    <RuleDefinitions>
      <DisplayRules>
        <DisplayRule Id="Mscrm.AddPrimaryToMarketingList">
          <EntityPrivilegeRule AppliesTo="PrimaryEntity" PrivilegeType="Append" PrivilegeDepth="Basic" />
          <EntityPrivilegeRule EntityName="list" PrivilegeType="AppendTo" PrivilegeDepth="Basic" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.OutlookRenderTypeWeb">
          <OutlookRenderTypeRule Type="Web" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.CanSavePrimaryEntityType">
          <OrRule>
            <Or>
              <EntityPrivilegeRule AppliesTo="PrimaryEntity" PrivilegeType="Create" PrivilegeDepth="Basic" />
            </Or>
            <Or>
              <EntityPrivilegeRule AppliesTo="PrimaryEntity" PrivilegeType="Write" PrivilegeDepth="Basic" />
            </Or>
          </OrRule>
          <EntityPrivilegeRule AppliesTo="PrimaryEntity" PrivilegeType="Read" PrivilegeDepth="Basic" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.PrimaryIsActivity">
          <EntityPropertyRule AppliesTo="PrimaryEntity" PropertyName="IsActivity" PropertyValue="true" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.CanSaveAndClosePrimaryEntityType">
          <OrRule>
            <Or>
              <EntityPrivilegeRule AppliesTo="PrimaryEntity" PrivilegeType="Create" PrivilegeDepth="Basic" />
            </Or>
            <Or>
              <EntityPrivilegeRule AppliesTo="PrimaryEntity" PrivilegeType="Write" PrivilegeDepth="Basic" />
            </Or>
          </OrRule>
        </DisplayRule>
        <DisplayRule Id="Mscrm.CreatePrimaryEntityPermission">
          <EntityPrivilegeRule AppliesTo="PrimaryEntity" PrivilegeType="Create" PrivilegeDepth="Basic" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.DeletePrimaryEntityPermission">
          <EntityPrivilegeRule AppliesTo="PrimaryEntity" PrivilegeType="Delete" PrivilegeDepth="Basic" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.CanWritePrimary">
          <EntityPrivilegeRule AppliesTo="PrimaryEntity" PrivilegeType="Write" PrivilegeDepth="Basic" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.PrimaryIsInactive">
          <FormStateRule State="Disabled" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.PrimaryEntityHasStatecode">
          <EntityPropertyRule AppliesTo="PrimaryEntity" PropertyName="HasStateCode" PropertyValue="true" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.PrimaryIsNotActivity">
          <EntityPropertyRule AppliesTo="PrimaryEntity" PropertyName="IsActivity" PropertyValue="false" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.PrimaryIsActive">
          <FormStateRule State="Existing" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.AppendToPrimary">
          <EntityPrivilegeRule AppliesTo="PrimaryEntity" PrivilegeType="AppendTo" PrivilegeDepth="Basic" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.CreateAndAppendNote">
          <EntityPrivilegeRule EntityName="annotation" PrivilegeType="Create" PrivilegeDepth="Basic" />
          <EntityPrivilegeRule EntityName="annotation" PrivilegeType="Append" PrivilegeDepth="Basic" />
          <EntityPrivilegeRule EntityName="annotation" PrivilegeType="Read" PrivilegeDepth="Basic" />
          <EntityPrivilegeRule EntityName="annotation" PrivilegeType="Write" PrivilegeDepth="Basic" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.PrimaryEntityHasNotes">
          <EntityPropertyRule AppliesTo="PrimaryEntity" PropertyName="HasNotes" PropertyValue="true" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.AssignPrimaryPermission">
          <EntityPrivilegeRule AppliesTo="PrimaryEntity" PrivilegeType="Assign" PrivilegeDepth="Basic" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.ShareRecordsAndSecuredFieldsPrimaryPermission">
          <OrRule>
            <Or>
              <EntityPrivilegeRule AppliesTo="PrimaryEntity" PrivilegeType="Share" PrivilegeDepth="Basic" />
            </Or>
            <Or>
              <EntityPrivilegeRule EntityName="principalobjectattributeaccess" PrivilegeType="Read" PrivilegeDepth="Basic" />
            </Or>
          </OrRule>
        </DisplayRule>
        <DisplayRule Id="Mscrm.SharePrimaryPermission">
          <EntityPrivilegeRule AppliesTo="PrimaryEntity" PrivilegeType="Share" PrivilegeDepth="Basic" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.ShareSecuredFieldsPrimaryPermission">
          <EntityPrivilegeRule EntityName="principalobjectattributeaccess" PrivilegeType="Read" PrivilegeDepth="Basic" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.AppendToQueue">
          <EntityPrivilegeRule EntityName="queue" PrivilegeType="AppendTo" PrivilegeDepth="Basic" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.WorksWithQueuePrimary">
          <EntityPropertyRule Default="false" AppliesTo="PrimaryEntity" PropertyName="WorksWithQueue" PropertyValue="true" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.CanCreateActivity">
          <MiscellaneousPrivilegeRule PrivilegeName="CreateActivity" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.CreateConnection">
          <MiscellaneousPrivilegeRule PrivilegeName="CreateConnection" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.IsConnectionsEnabledPrimary">
          <EntityPropertyRule Default="false" AppliesTo="PrimaryEntity" PropertyName="IsConnectionsEnabled" PropertyValue="true" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.ConvertActivity">
          <EntityPropertyRule AppliesTo="PrimaryEntity" PropertyName="IsActivity" PropertyValue="true" />
          <EntityPrivilegeRule EntityName="activitypointer" PrivilegeType="Write" PrivilegeDepth="Basic" />
          <EntityPrivilegeRule EntityName="activitypointer" PrivilegeType="AppendTo" PrivilegeDepth="Basic" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.ReadReport">
          <EntityPrivilegeRule EntityName="report" PrivilegeType="Read" PrivilegeDepth="Basic" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.PrintPrivilege">
          <MiscellaneousPrivilegeRule PrivilegeName="Print" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.HomepageGrid.account.Relationship">
          <EntityPrivilegeRule EntityName="relationshiprole" PrivilegeType="Read" PrivilegeDepth="Basic" />
          <EntityPrivilegeRule EntityName="account" PrivilegeType="AppendTo" PrivilegeDepth="Basic" />
          <OrRule>
            <Or>
              <EntityPrivilegeRule EntityName="customerrelationship" PrivilegeType="Create" PrivilegeDepth="Basic" />
              <EntityPrivilegeRule EntityName="customerrelationship" PrivilegeType="Append" PrivilegeDepth="Basic" />
              <EntityPrivilegeRule EntityName="contact" PrivilegeType="AppendTo" PrivilegeDepth="Basic" />
            </Or>
            <Or>
              <EntityPrivilegeRule EntityName="customeropportunityrole" PrivilegeType="Create" PrivilegeDepth="Basic" />
              <EntityPrivilegeRule EntityName="customeropportunityrole" PrivilegeType="Append" PrivilegeDepth="Basic" />
              <EntityPrivilegeRule EntityName="opportunity" PrivilegeType="AppendTo" PrivilegeDepth="Basic" />
            </Or>
          </OrRule>
        </DisplayRule>
        <DisplayRule Id="Mscrm.HomepageGrid.account.Relationship.Opportunity">
          <EntityPrivilegeRule EntityName="relationshiprole" PrivilegeType="Read" PrivilegeDepth="Basic" />
          <EntityPrivilegeRule EntityName="customeropportunityrole" PrivilegeType="Create" PrivilegeDepth="Basic" />
          <EntityPrivilegeRule EntityName="customeropportunityrole" PrivilegeType="Append" PrivilegeDepth="Basic" />
          <EntityPrivilegeRule EntityName="opportunity" PrivilegeType="AppendTo" PrivilegeDepth="Basic" />
          <EntityPrivilegeRule EntityName="account" PrivilegeType="AppendTo" PrivilegeDepth="Basic" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.HomepageGrid.account.Relationship.Customer">
          <EntityPrivilegeRule EntityName="relationshiprole" PrivilegeType="Read" PrivilegeDepth="Basic" />
          <EntityPrivilegeRule EntityName="customerrelationship" PrivilegeType="Create" PrivilegeDepth="Basic" />
          <EntityPrivilegeRule EntityName="customerrelationship" PrivilegeType="Append" PrivilegeDepth="Basic" />
          <EntityPrivilegeRule EntityName="contact" PrivilegeType="AppendTo" PrivilegeDepth="Basic" />
          <EntityPrivilegeRule EntityName="account" PrivilegeType="AppendTo" PrivilegeDepth="Basic" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.AddActivityToPrimary">
          <EntityPrivilegeRule AppliesTo="PrimaryEntity" PrivilegeType="AppendTo" PrivilegeDepth="Basic" />
          <EntityPrivilegeRule EntityName="activitypointer" PrivilegeType="Create" PrivilegeDepth="Basic" />
          <EntityPrivilegeRule EntityName="activitypointer" PrivilegeType="Append" PrivilegeDepth="Basic" />
          <EntityPropertyRule AppliesTo="PrimaryEntity" PropertyName="HasActivities" PropertyValue="true" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.CreateServiceAppointment">
          <EntityPrivilegeRule EntityName="service" PrivilegeType="Read" PrivilegeDepth="Basic" />
          <EntityPrivilegeRule EntityName="service" PrivilegeType="AppendTo" PrivilegeDepth="Basic" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.WriteActivityPermission">
          <EntityPrivilegeRule EntityName="activitypointer" PrivilegeType="Write" PrivilegeDepth="Basic" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.CreateCampaignResponse">
          <EntityPrivilegeRule EntityName="activitypointer" PrivilegeType="Append" PrivilegeDepth="Basic" />
          <OrRule>
            <Or>
              <EntityPrivilegeRule EntityName="campaign" PrivilegeType="AppendTo" PrivilegeDepth="Basic" />
            </Or>
            <Or>
              <EntityPrivilegeRule EntityName="activitypointer" PrivilegeType="AppendTo" PrivilegeDepth="Basic" />
            </Or>
          </OrRule>
        </DisplayRule>
        <DisplayRule Id="Mscrm.PrimaryEntityHasCampaignResponse">
          <OrRule>
            <Or>
              <EntityRule AppliesTo="PrimaryEntity" EntityName="account" />
            </Or>
            <Or>
              <EntityRule AppliesTo="PrimaryEntity" EntityName="contact" />
            </Or>
            <Or>
              <EntityRule AppliesTo="PrimaryEntity" EntityName="lead" />
            </Or>
            <Or>
              <EntityRule AppliesTo="PrimaryEntity" EntityName="incident" />
            </Or>
            <Or>
              <EntityRule AppliesTo="PrimaryEntity" EntityName="opportunity" />
            </Or>
            <Or>
              <EntityRule AppliesTo="PrimaryEntity" EntityName="quote" />
            </Or>
            <Or>
              <EntityRule AppliesTo="PrimaryEntity" EntityName="invoice" />
            </Or>
            <Or>
              <EntityRule AppliesTo="PrimaryEntity" EntityName="salesorder" />
            </Or>
            <Or>
              <EntityRule AppliesTo="PrimaryEntity" EntityName="contract" />
            </Or>
          </OrRule>
        </DisplayRule>
        <DisplayRule Id="Mscrm.MailMergePrimary">
          <EntityPropertyRule AppliesTo="PrimaryEntity" PropertyName="MailMergeEnabled" PropertyValue="true" />
          <EntityPrivilegeRule EntityName="activitypointer" PrivilegeType="Create" PrivilegeDepth="Basic" />
          <MiscellaneousPrivilegeRule PrivilegeName="MailMerge" />
          <OrRule>
            <Or>
              <MiscellaneousPrivilegeRule PrivilegeName="WebMailMerge" />
            </Or>
            <Or>
              <CrmClientTypeRule Type="Outlook" />
            </Or>
          </OrRule>
        </DisplayRule>
        <DisplayRule Id="Mscrm.WriteCustomization">
          <MiscellaneousPrivilegeRule PrivilegeName="WriteCustomization" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.IsCustomizable">
          <EntityPropertyRule AppliesTo="SelectedEntity" PropertyName="IsCustomizable" PropertyValue="true" />
        </DisplayRule>
        <DisplayRule Id="Mscrm.OpenCustomizations">
          <EntityPrivilegeRule PrivilegeType="Read" PrivilegeDepth="Global" EntityName="solution" />
          <EntityPrivilegeRule PrivilegeType="Read" PrivilegeDepth="Global" EntityName="publisher" />
        </DisplayRule>
      </DisplayRules>
      <EnableRules>
        <EnableRule Id="Mscrm.AddPrimaryToMarketingList">
          <RecordPrivilegeRule AppliesTo="PrimaryEntity" PrivilegeType="Append" />
          <CrmOfflineAccessStateRule State="Offline" InvertResult="true" />
        </EnableRule>
        <EnableRule Id="Mscrm.FormStateExistingOrReadOnly">
          <OrRule>
            <Or>
              <FormStateRule State="ReadOnly" />
            </Or>
            <Or>
              <FormStateRule State="Existing" />
            </Or>
          </OrRule>
        </EnableRule>
        <EnableRule Id="Mscrm.Form.{!EntityLogicalName}.MainTab">
          <EntityRule AppliesTo="PrimaryEntity" EntityName="{!EntityLogicalName}" />
          <CustomRule FunctionName="Mscrm.RibbonActions.primaryControlIsNotFormProxy" Library="/_static/_common/scripts/RibbonActions.js">
            <CrmParameter Value="PrimaryControl" />
          </CustomRule>
        </EnableRule>
        <EnableRule Id="Mscrm.Enabled">
          <CustomRule FunctionName="Mscrm.RibbonActions.alwaysEnabled" Library="/_static/_common/scripts/RibbonActions.js" />
        </EnableRule>
        <EnableRule Id="Mscrm.AvailableOnForm">
          <EntityRule AppliesTo="PrimaryEntity" Default="false" Context="Form" />
        </EnableRule>
        <EnableRule Id="Mscrm.CanSavePrimary">
          <OrRule>
            <Or>
              <RecordPrivilegeRule AppliesTo="PrimaryEntity" PrivilegeType="Create" />
              <FormStateRule State="Create" />
            </Or>
            <Or>
              <RecordPrivilegeRule AppliesTo="PrimaryEntity" PrivilegeType="Write" />
              <FormStateRule State="Existing" />
            </Or>
          </OrRule>
        </EnableRule>
        <EnableRule Id="Mscrm.ReadPrimaryPermission">
          <RecordPrivilegeRule AppliesTo="PrimaryEntity" PrivilegeType="Read" />
        </EnableRule>
        <EnableRule Id="Mscrm.FormStateNotNew">
          <FormStateRule State="Create" InvertResult="true" />
        </EnableRule>
        <EnableRule Id="Mscrm.CanDeletePrimary">
          <RecordPrivilegeRule AppliesTo="PrimaryEntity" PrivilegeType="Delete" />
        </EnableRule>
        <EnableRule Id="Mscrm.CanWritePrimary">
          <RecordPrivilegeRule AppliesTo="PrimaryEntity" PrivilegeType="Write" />
        </EnableRule>
        <EnableRule Id="Mscrm.AppendToPrimary">
          <RecordPrivilegeRule AppliesTo="PrimaryEntity" PrivilegeType="AppendTo" />
        </EnableRule>
        <EnableRule Id="Mscrm.AssignPrimaryPermission">
          <RecordPrivilegeRule AppliesTo="PrimaryEntity" PrivilegeType="Assign" />
        </EnableRule>
        <EnableRule Id="Mscrm.NotOffline">
          <CrmOfflineAccessStateRule State="Offline" InvertResult="true" />
        </EnableRule>
        <EnableRule Id="Mscrm.ShareRecordsAndSecuredFieldsPrimaryPermission">
          <OrRule>
            <Or>
              <RecordPrivilegeRule AppliesTo="PrimaryEntity" PrivilegeType="Share" />
            </Or>
            <Or>
              <CustomRule FunctionName="Mscrm.RibbonActions.hasSecuredFields" Library="/_static/_common/scripts/RibbonActions.js" />
            </Or>
          </OrRule>
        </EnableRule>
        <EnableRule Id="Mscrm.SharePrimaryPermission">
          <RecordPrivilegeRule AppliesTo="PrimaryEntity" PrivilegeType="Share" />
        </EnableRule>
        <EnableRule Id="Mscrm.ShareSecuredFieldsPrimaryPermission">
          <CustomRule FunctionName="Mscrm.RibbonActions.hasSecuredFields" Library="/_static/_common/scripts/RibbonActions.js" />
        </EnableRule>
        <EnableRule Id="Mscrm.EnablePromoteToResponse">
          <CustomRule FunctionName="Mscrm.RibbonActions.canPromoteActivityToResponse" Library="/_static/_common/scripts/RibbonActions.js" />
        </EnableRule>
        <EnableRule Id="Mscrm.ConvertActivity">
          <FormStateRule State="Create" InvertResult="true" />
          <FormStateRule State="Disabled" InvertResult="true" />
        </EnableRule>
        <EnableRule Id="Mscrm.RunWorkflowPrimary">
          <CustomRule FunctionName="Mscrm.RibbonActions.enableWorkflowOnForm" Library="/_static/_common/scripts/RibbonActions.js" />
        </EnableRule>
        <EnableRule Id="Mscrm.FormStateExisting">
          <FormStateRule State="Existing" />
        </EnableRule>
        <EnableRule Id="Mscrm.Disabled">
          <CustomRule FunctionName="Mscrm.RibbonActions.neverEnabled" Library="/_static/_common/scripts/RibbonActions.js" />
        </EnableRule>
        <EnableRule Id="Mscrm.Form.{!EntityLogicalName}.Related">
          <EntityRule AppliesTo="PrimaryEntity" EntityName="{!EntityLogicalName}" />
          <CustomRule FunctionName="Mscrm.RibbonActions.primaryControlIsNotFormProxy" Library="/_static/_common/scripts/RibbonActions.js">
            <CrmParameter Value="PrimaryControl" />
          </CustomRule>
        </EnableRule>
        <EnableRule Id="Mscrm.Form.{!EntityLogicalName}.Developer">
          <EntityRule AppliesTo="PrimaryEntity" EntityName="{!EntityLogicalName}" />
          <CustomRule FunctionName="Mscrm.RibbonActions.formPageDeveloperTabEnableRule" Library="/_static/_common/scripts/RibbonActions.js">
            <CrmParameter Value="PrimaryControl" />
          </CustomRule>
        </EnableRule>
        <EnableRule Id="Mscrm.FormDesignValid">
          <CustomRule FunctionName="Mscrm.RibbonActions.isFormDesignValid" Library="/_static/_common/scripts/RibbonActions.js">
            <CrmParameter Value="SelectedEntityTypeCode" />
          </CustomRule>
        </EnableRule>
      </EnableRules>
    </RuleDefinitions>
  </RibbonDefinition>
</RibbonDefinitions>